//
//  SNThemeCell.m
//  DayDayHappy
//
//  Created by yutao on 14-2-22.
//  Copyright (c) 2014年 yutao. All rights reserved.
//

#import "SNThemeCell.h"

@implementation SNThemeCell

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
    }
    return self;
}

- (void)setUpImageCellWithObject:(SNThemeModel*)imageModel atIndexPath:(NSIndexPath*)indexPath
{
    [super setUpImageCellWithObject:imageModel atIndexPath:indexPath];
    [contentImageView setFrame:CGRectMake(10, CGRectGetMinY(txtContent.frame) + CGRectGetHeight(txtContent.frame) +10, kCellContentWidth, ceilf((imageModel.height ? imageModel.height : 200) * (kCellContentWidth / (imageModel.width ? imageModel.width : 300))))];
    [contentImageView setImageWithURL:[NSURL URLWithString:imageModel.image] placeholderImage:[UIImage imageNamed:@""] options:SDWebImageRefreshCached];
    
    [self setFrame:CGRectMake(10, 0, kCellContentWidth, CGRectGetMinY(contentImageView.frame) + CGRectGetHeight(contentImageView.frame) + 20)];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
